<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        /*   let p1 = new Promise((resolve, reject) => {
              let count = 3;
              console.log('同步');
  
              if (count > 5) {
                  resolve('成功')
              } else {
                  reject('失败')
              }
          })
          console.log(p1)
  
          p1.then(
              (res) => {
                  console.log(res)
              },
              (err) => {
                  console.log(err)
              }
          )
          console.log('final') */

        /* let p1 = new Promise((resolve, reject) => {
            let count = 3;
            if (count >= 3) {
                resolve('成功')
            } else {
                reject('失败')
            }
        }).then(
            res => console.log(res),
            err => console.log(err)
        ) */

      /*   let p1 = new Promise((resolve, reject) => {
            let status = 404;
            if (status !== 404) {
                resolve('成功')
            } else {
                reject('失败')
            }
        }).then(res => console.log(res),
            err => console.log(err)) */
    </script>
</body>

</html>